<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>教师登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../static/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">id</label>
                    <div class="layui-input-inline">
                        <input type="text" id="id" name="id" lay-verify="required|phone" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
            <br/>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" name="name" lay-verify="required|phone" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
            <br/>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="password" lay-verify="required|phone" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
            <br/>


            <br/>

        </form>

    </div>
</div>

<script src="../../static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            ,layer = layui.layer
			, $ = layui.jquery;
       $(document).ready(
           //获取教师信息
           getTeacherInfo()

       )
        function teacherInfo(data) {
            $("#id").val(data.teaId)
            $("#name").val(data.teaName)
            $("#password").val(data.teaPassword)
            form.render();
        }
        function getTeacherInfo() {
            $.ajax({
                type : "get",
                async:true,
                url : 'http://localhost:8888/teacher/queryOwnInfo',
                dataType : "json",
                xhrFields: { //
                    withCredentials: true,
                },
                contentType : "application/json",
                success : function(resp){
                    console.log(resp.data);
                    teacherInfo(resp.data)


					
                }
            });
        }
    });
</script>
</body>
</html>
